# coding=utf-8
from pymysqlreplication import BinLogStreamReader

mysql_settings = {'host': '10.20.0.254', 'port': 3306, 'user': 'root', 'passwd': '123465'}

stream = BinLogStreamReader(connection_settings = mysql_settings, server_id=100,log_file='binlog.000003',log_pos=69727,blocking=True,resume_stream=True)

for binlogevent in stream:
    print binlogevent.dump()

stream.close()